package site.assad.conf3;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import site.assad.conf.LogDao;
import site.assad.conf.LogonService;
import site.assad.conf.UserDao;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/11/30 17:42
 * Description: 引用 xml 配置文件进行 bean 的定义
 */
@Configuration
@ImportResource("classpath:site/assad/conf/beanConf3.xml")  //引入XML配置文件
public class LogonServiceConfig {

    @Bean
    @Autowired
    public LogonService logonService(UserDao userDao, LogDao logDao){
        LogonService logonService = new LogonService();
        logonService.setLogDao(logDao);
        logonService.setUserDao(userDao);
        return logonService;
    }
}
